randomize-harmony seed how l-range h-range pattern
This function creates a chromatically-altered solo or chordal variant from a symbol-pattern. In music that adopts a diatonic tonality this function can be invaluable for making solo or chordal passages that add chromatic tension and instability. The how keyword provides for 'solo or 'mix forms, the latter mixing the original pattern with the chromatically-altered version. Chromatic alteration can be between l-range and h-range values in semitones.
(randomize-harmony 0.45 'solo -5 7 '(a b c d e f g))
--> ((-2 a) (2 b) (4 c) (2 d) (2 e) (6 f) (-3 g))
(randomize-harmony 0.45 'mix -5 7 '(a b c d e f g))
--> ((a -2 a) (b 2 b) (c 4 c) (d 2 d) (e 2 e) (f 6 f) (g -3 g))
Use with eval-shield for finer control over the incidence of chromatic alteration. Or, adopt the following technique:
(setq mel (gen-variants 0.343 2 '(a b c d f g)))
--> (a b c d f g c d b a g g b d b b d f)
(setq chromatic-mel
(randomize-harmony 0.23 'solo -7 5
(filter-delete '(b c d) mel)))
--> ((-3 a) = = = (0 f) (2 g) = = = (-1 a) (-4 g) (5 g)
= = = = = (-3 f))
(setq preserve-mel
(filter-preserve mel '(b c d)))
--> (b c d c d b b d b b d)
(symbol-mix chromatic-mel
(fill-rest chromatic-mel preserve-mel))
--> ((-3 a) b c d (0 f) (2 g) c d b (-1 a) (-4 g) (5 g)